package com.pni.game.cards.components;

import java.util.Collection;
import java.util.List;

import com.pni.game.cards.Card;
import com.pni.game.cards.CardHolder;
import com.pni.game.cards.deck.Deck;


public class StandardDealer implements DealerInterface {
	
	protected Deck deck;
	
	public StandardDealer(Deck deck) {
		this.deck = deck;
	}

	public void shuffleDeck() {
		deck.shuffleCards();
	}

	public void distributeCards(CardHolder cardHolder, int number) {
		for(int cards = 0; cards < number; cards++){
			cardHolder.addCard(deck.drawCard());
		}
	}

	public void collectCards(CardHolder cardHolder, int number) {
		for(int cardNumber = 0; cardNumber < number; cardNumber++){
			deck.placeCardOnDeck(cardHolder.takeCard());
		}
	}
	
	public void collectAllCards(CardHolder cardHolder) {
		collectCards(cardHolder, cardHolder.numberOfCards());
	}

}
